package com.tanhua.es.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.elasticsearch.common.geo.GeoPoint;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.GeoPointField;


/**
 * @description:
 * @author: Administrator
 * @date: Created in 2021/2/28 21:30
 * @version: 0.0.1
 * @modified By:
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "tanhua",type = "user_location",shards = 6,replicas = 2)
public class UserLocationES {
    @Id
    private Long userId; //用户id

    @GeoPointField
    private GeoPoint location; //x经度 y纬度

    @Field(type = FieldType.Keyword)
    private  String address; //位置描述

    @Field(type = FieldType.Long)
    private Long created;//创建时间

    @Field(type = FieldType.Long)
    private Long updated; //更新时间

    @Field(type = FieldType.Long)
    private Long lastUpdated; //上次更新时间
}
